using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using TM.Data.Contracts;
using TM.DataAccessor;
using TM.ExceptionManager;
using TM.Model;

namespace TM.Data
{
    public class ResourceRepository : IResourceRepository
    {
        private IDataAccessor _dataAccessor;
        private ITMExceptionHandler _exceptionHandler;

        public ResourceRepository(IIoCParams ioCParams)
        {
            _dataAccessor = ioCParams.DataAccessor;
            _exceptionHandler = ioCParams.ExceptionHandler;
#if DEBUG
            _exceptionHandler.Throwable = true;
#endif
        }

        #region Implementation of IRepository<DMNhanVien>

        public IQueryable<DMNhanVien> GetAll()
        {
            throw new NotImplementedException();
        }

        public DataTable GetAllAsDataTable()
        {
            throw new NotImplementedException();
        }

        public DMNhanVien GetById(Guid id)
        {
            return GetAllOfTask(new Guid[] { new Guid("DF255822-64AB-4879-B103-1B4C61C6CA54"), 
                new Guid("73E15922-CE40-48D6-81ED-7962A9B122BA") }).First();
        }

        public DataTable GetByIdAsDataTable(Guid id)
        {
            throw new NotImplementedException();
        }

        public IQueryable<DMNhanVien> GetList(Func<DMNhanVien, bool> predicate)
        {
            throw new NotImplementedException();
        }

        public DMNhanVien GetSingle(Func<DMNhanVien, bool> predicate)
        {
            throw new NotImplementedException();
        }

        public DMNhanVien GetFisrt(Func<DMNhanVien, bool> predicate)
        {
            throw new NotImplementedException();
        }

        public bool Insert(DMNhanVien entity)
        {
            throw new NotImplementedException();
        }

        public bool Insert(IList<DMNhanVien> entities)
        {
            throw new NotImplementedException();
        }

        public bool Update(DMNhanVien entity)
        {
            throw new NotImplementedException();
        }

        public bool Update(IList<DMNhanVien> entities)
        {
            throw new NotImplementedException();
        }

        public bool Delete(DMNhanVien entity)
        {
            throw new NotImplementedException();
        }

        public bool Delete(IList<DMNhanVien> entities)
        {
            throw new NotImplementedException();
        }

        public bool Delete(Guid id)
        {
            throw new NotImplementedException();
        }

        public bool Delete(Func<DMNhanVien, bool> predicate)
        {
            throw new NotImplementedException();
        }

        public IQueryable<DMNhanVien> GetAllOfTask(Guid[] ids)
        {
            return new List<DMNhanVien>
                       {
                           new DMNhanVien() {ID = new Guid("DF255822-64AB-4879-B103-1B4C61C6CA54"), Name = "Phan Thanh Huy"},
                           new DMNhanVien() {ID = new Guid("73E15922-CE40-48D6-81ED-7962A9B122BA"), Name = "Tran Van Hung"}
                       }.AsQueryable();
        }

        #endregion
    }
}